import React, { Component } from 'react';
import '../styles/Search.scss'

class Search extends Component {
    constructor(props){
        super(props);
        this.state = {
            list:[{name:'笔记本支架'},{name:'applePencil'},{name:'转接头'},{name:'数据线'},{name:'挂耳式咖啡'},{name:'防晒露'},{name:'衬衫'},]
        }
    }
    goback(){
        this.props.history.go(-1)
    }
    render() {
        return (
            <div className='search'>
                <div className="input-box">
                    <span onClick={()=>{this.goback()}} className='s1'>＜</span>
                    <input type="text" placeholder='防晒囤货季'/>
                    <span onClick={()=>{this.goback()}} className='s2'>取消</span>
                </div>
                <div className="last">
                    <div className="title">
                        <div className="left">历史记录</div>
                        <div className="right">й</div>
                    </div>
                    <div className="list">
                        {
                            this.state.list.map((item,index)=>{
                                return (
                                    <div key={index}>{item.name}</div>
                                )
                            })
                        }
                    </div>
                </div>
            </div>
        );
    }
}

export default Search;